
package com.ap.core.validation.message.rules;

import com.ap.core.message.managepayment.info.RetrieveRTPMessageInfo;
import com.ap.core.validation.message.info.MessageValidationInfo;
import com.ap.core.validation.message.info.RTPOriginalInfo;
import com.ap.core.validation.rules.AbstractValidationRule;

/**
 * User: Ranjit.Singh
 * The element <apTRId> should  be identical(same as)to  the APTRId in the transaction identified by the given APTransaction Id.
 */

public class RV0010Rule extends AbstractValidationRule<MessageValidationInfo<RetrieveRTPMessageInfo, RTPOriginalInfo>> {


	@Override
	public boolean validate(
			MessageValidationInfo<RetrieveRTPMessageInfo, RTPOriginalInfo> infoObject) {
		
		boolean pass = true;
		if(null != infoObject.getBoundObject().getRequestInfo().getApTRId()){
			pass =  infoObject.getBoundObject().getRequestInfo().getApTRId().equals(infoObject.getOriginalInfo().getOriginalAPTrId());
		}
		
		return pass;
	}


}


